create  table jms_dm.dm_transfer_mistake_send_detail_dt 
(
waybill_no varchar(100) COMMENT '' ,
sign_time timestamp COMMENT '' ,
sign_site varchar(100) COMMENT '' ,
sign_site_code varchar(100) COMMENT '' ,
out_distribution_code varchar(100) COMMENT '' ,
out_distribution_name varchar(100) COMMENT '' ,
send_time timestamp COMMENT '' ,
center_name varchar(100) COMMENT '' ,
center_code varchar(100) COMMENT '' ,
scan_user varchar(100) COMMENT '' ,
scan_user_code varchar(100) COMMENT '' ,
source varchar(100) COMMENT '' ,
pistol_id varchar(100) COMMENT '' ,
next_station_code varchar(100) COMMENT '' ,
next_network_type varchar(100) COMMENT '' ,
package_code varchar(100) COMMENT '' ,
transfer_code varchar(100) COMMENT '' ,
ordersource_name varchar(100) COMMENT '' ,
waybill_dest_center_code varchar(100) COMMENT '' ,
waybill_dest_center_name varchar(100) COMMENT '' ,
waybill_terminal_dispatch_code varchar(100) COMMENT '' ,
order_dest_center_code varchar(100) COMMENT '' ,
order_dest_center_name varchar(100) COMMENT '' ,
order_terminal_dispatch_code varchar(100) COMMENT '' ,
new_reback_terminal_code varchar(100) COMMENT '' ,
new_receiver_province_id varchar(100) COMMENT '' ,
new_receiver_city_id varchar(100) COMMENT '' ,
new_receiver_area_id varchar(100) COMMENT '' ,
is_reback_before varchar(100) COMMENT '' ,
rk1 varchar(100) COMMENT '' ,
old_receiver_province_id varchar(100) COMMENT '' ,
old_receiver_city_id varchar(100) COMMENT '' ,
old_receiver_area_id varchar(100) COMMENT '' ,
is_reback_after varchar(100) COMMENT '' ,
apply_type_code varchar(100) COMMENT '' ,
old_reback_terminal_code varchar(100) COMMENT '' ,
rk2 varchar(100) COMMENT '' ,
terminal_dispatch_code varchar(100) COMMENT '' ,
first_code varchar(100) COMMENT '' ,
second_code varchar(100) COMMENT '' ,
third_code varchar(100) COMMENT '' ,
fst_dest_center_code varchar(100) COMMENT '' ,
fst_dest_center_name varchar(100) COMMENT '' ,
dest_center_code varchar(100) COMMENT '' ,
arr_next_code varchar(100) COMMENT '' ,
arr_next_name_desc varchar(100) COMMENT '' ,
arr_next_code_desc varchar(100) COMMENT '' ,
dispatch_task_no varchar(100) COMMENT '' ,
temp_actual_shipment_no varchar(100) COMMENT '' ,
package_number bigint COMMENT '' ,
create_package_org_code varchar(100) COMMENT '' ,
create_package_org_name varchar(100) COMMENT '' ,
is_delete_flag varchar(100) COMMENT '' ,
is_tab_bagging_flag varchar(100) COMMENT '' ,
tab_bagging_source varchar(100) COMMENT '' ,
 varchar(100) COMMENT '' )
ENGINE=OLAP
DUPLICATE KEY(填写key)
comment 'insert overwrite table bidefault.dm_transfer_mistake_merge_test1 
dm_transfer_mistake_merge_test1 as ('
PARTITION BY RANGE (date_time) ( 
   START ("2023-07-31") END ("2023-09-29") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(site_code) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);